var o = getApp(), t = require("../../utils/themeSkin/skinBehavior");

Page({
    behaviors: [ t ],
    data: {
        liveInfo: {},
        posterShow: !1,
        rid: null
    },
    onLoad: function(o) {
        if (o.scene) {
            var t = decodeURIComponent(o.scene);
            if (t) {
                var e = t.split("=");
                "roomid" == e[0] && (this.roomid = e[1]);
            }
        }
        o.roomid && (this.roomid = o.roomid), this.getiPnoneBottom(), this.getLive();
    },
    getLive: function() {
        var t = this, e = o.getNetAddresss("plugin.appletslive.frontend.controllers.live.get-detail");
        o._postNetWork({
            url: e,
            data: {
                roomid: this.roomid
            },
            success: function(e) {
                var i = e.data;
                if (0 == i.result) return o.tips(i.msg);
                t.setData({
                    liveInfo: i.data,
                    rid: i.data.has_one_room.roomid
                });
            },
            fail: function(o) {
                console.log(o);
            }
        });
    },
    gotoLive: function() {
        if (101 == this.data.liveInfo.has_one_room.live_status || 0 == this.data.liveInfo.has_one_room.close_replay) {
            var o = this.roomid, t = {
                mid: wx.getStorageSync("yz_uid")
            };
            wx.navigateTo({
                url: "plugin-private://wx2b03c6e691cd7370/pages/live-player-plugin?room_id=".concat(o, "&custom_params=").concat(encodeURIComponent(JSON.stringify(t)))
            });
        }
    },
    sharePosterPop: function() {
        this.setData({
            posterShow: !0
        });
    },
    getiPnoneBottom: function() {
        try {
            wx.getStorageSync("iPhoneBottom") && this.setData({
                iPnoneBottomBol: !0
            });
        } catch (o) {}
    },
    onReady: function() {},
    onShow: function() {},
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {},
    onShareAppMessage: function() {
        return {
            path: "/packageD/wxliveDetail/wxliveDetail?roomid=".concat(this.roomid)
        };
    }
});